/*
 *  Point.cpp
 *  zray-gui
 *
 *  Created by czalkin on 2/19/09.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */

#include "Point3.hpp"

Point3& Point3::operator+=( const Vector3 &rhs )
{
	v[0] += rhs.v[0];
	v[1] += rhs.v[1];
	v[2] += rhs.v[2];
	return *this; 
}

Point3::Point3( const Vector3 &in )
{
	v[0] = in.v[0];
	v[1] = in.v[1];
	v[2] = in.v[2];		
}

Point3 Point3::operator+( const Vector3 &rhs ) const
{
	const float x = v[0] + rhs.v[0];
	const float y = v[1] + rhs.v[1];
	const float z = v[2] + rhs.v[2];
	return Point3( x, y, z ); 
}


Point3 Point3::operator-( const Point3 &rhs ) const
{
	const float x = v[0] - rhs.v[0];
	const float y = v[1] - rhs.v[1];
	const float z = v[2] - rhs.v[2];
	return Point3( x, y, z ); 
}


float Point3::dot( const Point3 &rhs ) const
{
	return v[0]*rhs.v[0] + v[1]*rhs.v[1] + v[2]*rhs.v[2];
}

float Point3::dot( const Vector3 &rhs ) const
{
	return v[0]*rhs.v[0] + v[1]*rhs.v[1] + v[2]*rhs.v[2];
}

